package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

@AllArgsConstructor
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class SysResult implements Serializable {
    private Integer status;
    private String msg;
    private  Object data;

    //1.失败的时候,分为三种传参情况!
    public static  SysResult fail(){
          return new  SysResult(201,"访问业务失败!",null);
    }

    public static  SysResult fail(Object data){
        return new  SysResult(201,"访问业务失败!",data);
    }

    public static  SysResult fail(String msg,Object data){
        return new  SysResult(201,msg,data);
    }

    //2.当成功的时候,分为三种传参情况!
    public static SysResult success(){
        return new  SysResult(200,"后台服务器访问成功!",null);
    }

    public static SysResult success(Object data){
        return new  SysResult(200,"后台服务器访问成功!",data);
    }

    public static SysResult success(Object data,String msg){
        return new  SysResult(200,msg,data);
    }
}
